
const mongoose = require('mongoose')

//创建集合规则 courseSchema 中就是集合的规则
const BookcoverSchema = new mongoose.Schema({
    book_author: {
        type: String,
        required: true
    },
    book_title: {
        type: String,
        required: true,
        unique:true
    },
    book_coverurl:{
        type:String,
    },
    book_max_type: {
        type: String,
    },
    book_min_type: {
        type: String,
    },
    book_min_describe: {
        type: String,
    },
})

//使用规则创建集合
const Bookcover = mongoose.model("Bookcover", BookcoverSchema) //courses文件名 ,以上部分可以看成创建了一个类


module.exports = {
    Bookcover
}